package models

import (
	"good_srv/good"
	"gorm.io/gorm"
)

type Qx struct {
	gorm.Model
	Qname string `gorm:"type:varchar(150);not null;commit:'权限内容'"`
}
type People struct {
	gorm.Model
	Name string `gorm:"type:varchar(150);not null;commit:'角色名字'"`
	QxId int64  `gorm:"type:int(150);not null;commit:'角色名字'"`
}
type Qp struct {
	Name  string
	Qname string
}

func (m *People) PeopleList() (peoplelist []*good.PeopleList, err error) {
	query := DB.Model(&Qx{}).
		Select("peoples.name,qxes.qname").
		Joins("left qxes on peoples.qx_id = qxs.id")
	query.Find(&peoplelist)
	return
}
